#ifndef LISTDEFINE_HPP
#define LISTDEFINE_HPP

#include <math.h>

class CBaseImage;

namespace DuiLib
{


struct NodeData
{
	int level;   //0 patient, 1 study, 2 series, 3 image
	int index;
	bool folder;
	bool childVisible;
	bool hasChild;
	DString text1;
	DString text2;
	DString text3;
	DString value;
	CContainerUI* listElment;
	CBaseImage* pImg;
	NodeData()
	{
		listElment = nullptr;
		pImg = nullptr;
	}

};

double CalculateDelay(double state);

class Node
{
public:
	Node();
	explicit Node(NodeData t);
	Node(NodeData t, Node* parent);
	~Node();
	NodeData& data();
	int GetChildrenNumber() const;
	Node* child(int i);
	Node* parent();
	bool folder() const;
	bool hasChildren() const;
	void AddChild(Node* child);
	void RemoveChild(Node* child);
	Node* GetLastChild();
	vector<Node*>* GetChildren();

private:
	void SetParent(Node* parent);

private:
	typedef std::vector <Node*>	Children;

	Children	_children;
	Node*		_parent;

	NodeData    _data;
};

} // DuiLib

#endif // LISTDEFINE_HPP